Integrand size = 21, antiderivative size = 59 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {2 a b \text {arctanh}(\sin (c+d x))}{d}-\frac {\left (a^2+b^2\right ) \cot (c+d x)}{d}-\frac {2 a b \csc (c+d x)}{d}+\frac {b^2 \tan (c+d x)}{d} \]
[Out]
Time = 0.49 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3957, 2990, 2701, 327, 213, 14} \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {\left (a^2+b^2\right ) \cot (c+d x)}{d}+\frac {2 a b \text {arctanh}(\sin (c+d x))}{d}-\frac {2 a b \csc (c+d x)}{d}+\frac {b^2 \tan (c+d x)}{d} \]
[In]
[Out]
Rule 14
Rule 213
Rule 327
Rule 2701
Rule 2990
Rule 3957
Rubi steps \begin{align*} \text {integral}& = \int (-b-a \cos (c+d x))^2 \csc ^2(c+d x) \sec ^2(c+d x) \, dx \\ & = (2 a b) \int \csc ^2(c+d x) \sec (c+d x) \, dx+\int \left (b^2+a^2 \cos ^2(c+d x)\right ) \csc ^2(c+d x) \sec ^2(c+d x) \, dx \\ & = \frac {\text {Subst}\left (\int \frac {a^2+b^2+b^2 x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}-\frac {(2 a b) \text {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d} \\ & = -\frac {2 a b \csc (c+d x)}{d}+\frac {\text {Subst}\left (\int \left (b^2+\frac {a^2+b^2}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}-\frac {(2 a b) \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d} \\ & = \frac {2 a b \text {arctanh}(\sin (c+d x))}{d}-\frac {\left (a^2+b^2\right ) \cot (c+d x)}{d}-\frac {2 a b \csc (c+d x)}{d}+\frac {b^2 \tan (c+d x)}{d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(138\) vs. \(2(59)=118\).
Time = 1.14 (sec) , antiderivative size = 138, normalized size of antiderivative = 2.34 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {\csc ^3\left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (4 a b \cos (c+d x)+\left (a^2+2 b^2\right ) \cos (2 (c+d x))+a \left (a+2 b \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin (2 (c+d x))\right )\right )}{4 d \left (-1+\cot ^2\left (\frac {1}{2} (c+d x)\right )\right )} \]
[In]
[Out]
Time = 1.00 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.29
method | result | size |
derivativedivides | \(\frac {-a^{2} \cot \left (d x +c \right )+2 a b \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+b^{2} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )}{d}\) | \(76\) |
default | \(\frac {-a^{2} \cot \left (d x +c \right )+2 a b \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+b^{2} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )}{d}\) | \(76\) |
parallelrisch | \(\frac {-8 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \cos \left (d x +c \right )+8 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \cos \left (d x +c \right )-\left (\left (a^{2}+2 b^{2}\right ) \cos \left (2 d x +2 c \right )+a \left (a -4 b \right )\right ) \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right )-8 a b \cot \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d \cos \left (d x +c \right )}\) | \(119\) |
risch | \(-\frac {2 i \left (2 a b \,{\mathrm e}^{3 i \left (d x +c \right )}+a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+2 a b \,{\mathrm e}^{i \left (d x +c \right )}+a^{2}+2 b^{2}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) | \(122\) |
norman | \(\frac {\frac {a^{2}+2 a b +b^{2}}{2 d}-\frac {\left (a^{2}+3 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}-\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(136\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.76 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {a b \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - a b \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}{d \cos \left (d x + c\right ) \sin \left (d x + c\right )} \]
[In]
[Out]
\[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \csc ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.20 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.24 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {a b {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + b^{2} {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )} + \frac {a^{2}}{\tan \left (d x + c\right )}}{d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 167 vs. \(2 (59) = 118\).
Time = 0.33 (sec) , antiderivative size = 167, normalized size of antiderivative = 2.83 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {4 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 4 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 5 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a^{2} - 2 \, a b - b^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \]
[In]
[Out]
Time = 14.58 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.83 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a-b\right )}^2}{2\,d}-\frac {2\,a\,b+a^2+b^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (a^2+2\,a\,b+5\,b^2\right )}{d\,\left (2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )}+\frac {4\,a\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]
[In]
[Out]